package edu.lingnan.mapper;

import edu.lingnan.pojo.MyOrder;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import org.apache.ibatis.annotations.Delete;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;

import java.util.List;

/**
 * @Entity edu.lingnan.pojo.MyOrder
 */
@Mapper
public interface MyOrderMapper extends BaseMapper<MyOrder> {

    @Select("select * from my_order where user_id=#{id}")
    List<MyOrder> selectAllMyOrder(Long id);

    @Select("select * from my_order where id=#{id}")
    List<MyOrder> selectOrderByOrderId(Long id);

    @Select("select * from my_order where store_id=#{id}")
    List<MyOrder> selectOrderByStoreId(Long id);

    @Delete("delete from my_order where id=#{id}")
    int deleteOrderByOrderId(Long id);


    void addOrder(MyOrder order);
}




